package com.picket.domain;

import java.io.Serializable;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.google.appengine.api.datastore.Key;
@PersistenceCapable
public class UserPool implements Serializable {

	private static final long serialVersionUID = -1595990757561334686L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String userId;

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String userEmail;
	

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String eventName;

	@NotNull
	@Persistent
	private Long eventId;

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String poolKeyword;

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String poolOwnerUserEmail;

	@NotNull
	@Size(min = 1, max = 25)
	@Persistent
	private String poolName;

	@NotNull
	@Persistent
	private Long poolId;

	@Persistent
	private Integer pointsScored;

	@Persistent
	private Integer standing; // rank

	@Persistent
	private Integer correctPredictions;

	@Persistent
	private Integer incorrectPredictions;

	public UserPool(String userId, String email, String nickname) {
		this.poolOwnerUserEmail = userId;
		this.eventName = email;
		this.poolKeyword = nickname;
	}
/*
	public UserPool(String userId, String email, String nickname,
			String forename, String surname, Set<AppRole> roles, boolean enabled) {
		this.poolOwnerUserEmail = userId;
		this.eventName = email;
		this.poolKeyword = nickname;
		this.poolName = forename;
	}
*/	
	public UserPool(String userId,String userEmail, String eventName, Long eventId,
			String poolKeyword, String poolOwnerUserEmail, String poolName,
			Long poolId) {
		super();
		this.userId = userId;
		this.userEmail = userEmail;
		this.eventName = eventName;
		this.eventId = eventId;
		this.poolKeyword = poolKeyword;
		this.poolOwnerUserEmail = poolOwnerUserEmail;
		this.poolName = poolName;
		this.poolId = poolId;
	}
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Integer getPointsScored() {
		return pointsScored;
	}

	public void setPointsScored(Integer pointsScored) {
		this.pointsScored = pointsScored;
	}

	public Integer getStanding() {
		return standing;
	}

	public void setStanding(Integer standing) {
		this.standing = standing;
	}

	public Integer getCorrectPredictions() {
		return correctPredictions;
	}

	public void setCorrectPredictions(Integer correctPredictions) {
		this.correctPredictions = correctPredictions;
	}

	public Integer getIncorrectPredictions() {
		return incorrectPredictions;
	}

	public void setIncorrectPredictions(Integer incorrectPredictions) {
		this.incorrectPredictions = incorrectPredictions;
	}

	public Long getEventId() {
		return eventId;
	}

	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	public Long getPoolId() {
		return poolId;
	}

	public void setPoolId(Long poolId) {
		this.poolId = poolId;
	}

	public Key getKey() {
		return key;
	}

	public Long getId() {
		return key.getId();
	}

	public String getPoolOwnerUserEmail() {
		return poolOwnerUserEmail;
	}

	public void setPoolOwnerUserEmail(String poolOwnerUserEmail) {
		this.poolOwnerUserEmail = poolOwnerUserEmail;
	}

	public String getEventName() {
		return eventName;
	}

	public void setEventName(String eventName) {
		this.eventName = eventName;
	}

	public String getPoolKeyword() {
		return poolKeyword;
	}

	public void setPoolKeyword(String poolKeyword) {
		this.poolKeyword = poolKeyword;
	}

	public String getPoolName() {
		return poolName;
	}

	public void setPoolName(String poolName) {
		this.poolName = poolName;
	}

	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

}